import java.util.logging.Level;
import java.util.logging.Logger;

// default log config file jre/lib/logging.properties
// to change 
// java -Djava.util.logging.config.file= configFile MainClass
public class Main {
    private static final Logger myLogger = Logger.getLogger("com.mycompany.myapp");

    public static void main(String... args) {
        logB();
        logA();
        logB();
    }

    public static void logA() {
        Logger.getGlobal().setLevel(Level.INFO); // this is a java bug
        Logger.getGlobal().info("currently not off");

        Logger.getGlobal().setLevel(Level.OFF);
        Logger.getGlobal().info("this log won't be print");
    }

    public static void logB() {
        myLogger.info("hello");
    }
}